﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

using QuDao;
using FineUICore;
using Kalman;
using Kalman.Extensions;

namespace AdminUI.Pages.BaseData
{
    public partial class AreaEditModel : BaseModel
    {
        public void OnGet(int id)
        {
            Current = AreaBO.Instance.GetItem<Area>(id);
        }

        public Area Current { get; set; }

        public IActionResult OnPostBtnSubmit_Click(Area dto)
        {
            AreaBO.Instance.Modify(dto);
            LogAction(ActionType.修改, $"修改行政区域：{dto.AreaID}-{dto.AreaName}");

            //FineUICore.PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
            ActiveWindow.HidePostBack();
            return UIHelper.Result();
        }

    }
}